import { DataMgr } from "./data.js";

const dataMgr = new DataMgr();
const colors = ['#FFB6C1', '#DDA0DD', '#ADD8E6', '#7FFFAA', '#228B22', '#BDB76B', '#F0E68C', '#FFA500', '#FF7F50', '#F08080', '#808080', '#32CD32', '#00FFFF', '#00BFFF', '#6A5ACD'];
const tagColorMap: Record<string, string> = {};
let colorIdx = 0;
const getTagColor = (tagName: string) => {
    let color = tagColorMap[tagName];
    if (!color) {
        if (colorIdx >= colors.length) colorIdx = 0;
        tagColorMap[tagName] = color = colors[colorIdx++];
    }
    return color;
}
globalThis.engine =  {
    supportClipboard: true,
    dataMgr,
    getTagColor
};
